

def crc(data):
    def subCrc(char, old_crc):
        new_crc = old_crc ^ ord(char)
        for i in range(0, 8):
            if new_crc & 0x01:
                new_crc = (new_crc / 2) ^ 0x8C
            else:
                new_crc /= 2
        return new_crc
    
    mycrc = 0
    for subdata in data:
        mycrc = subCrc(subdata, mycrc)
    return mycrc

